<div class="row dd_input_group {$form[type].extra_class|default=''}" id="form_group_{$form[type].id}">
    <div class="form-group">
        <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l" for="{$form[type].id}_daterange">{$form[type].title|htmlspecialchars}</label>
        <div class="col-xs-7 col-sm-6 col-md-4 col-lg-4">

            <div class="input-daterange input-group" id="{$form[type].id}_daterange" data-date-format="{$form[type].format ? $form[type].format : 'yyyy-mm-dd'}" {$form[type].extra_attr|default=''}>
                <input class="form-control" type="text" id="{$form[type].id_from}" name="{$form[type].name_from}" value="{$form[type].value_from|default=''}" placeholder="{$form[type].format}" autocomplete="off">
                <span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>
                <input class="form-control" type="text" id="{$form[type].id_to}" name="{$form[type].name_to}" value="{$form[type].value_to|default=''}" placeholder="{$form[type].format}" autocomplete="off">
            </div>

        </div>
        <div class="col-xs-{if $form[type].tips}12{else /}1{/if} col-sm-4 col-md-6 col-lg-6 dd_ts">
            {notempty name="form[type].required"} *{/notempty}
            {notempty name="form[type].tips"} {$form[type].tips|raw}{/notempty}
        </div>
    </div>
</div>
<script>
    $(function () {
        var date_format = $('#{$form[type].id}_daterange').attr('data-date-format');
        //如果格式中含有 hh 或 ii 或 ss 则为0，否则为2
        var minView = 2;
        if (date_format.indexOf("hh") > 0 || date_format.indexOf("ii") > 0 || date_format.indexOf("ss") > 0) {
            minView = 0;
        }
        $('#{$form[type].id_from},#{$form[type].id_to}').datetimepicker({
            autoclose: true,
            format: date_format, //yyyy-mm-dd hh:ii:ss
            language: "zh-CN",
            todayHighlight: true,//高亮当前日期
            minView: minView, //最精确的时间
        })
    })
</script>

